import request from '@/utils/request'

// 创建应急物资
export function createEmergencyMaterials(data) {
  return request({
    url: '/biz/emergency-materials/create',
    method: 'post',
    data: data
  })
}

// 更新应急物资
export function updateEmergencyMaterials(data) {
  return request({
    url: '/biz/emergency-materials/update',
    method: 'put',
    data: data
  })
}

// 删除应急物资
export function deleteEmergencyMaterials(id) {
  return request({
    url: '/biz/emergency-materials/delete?id=' + id,
    method: 'delete'
  })
}

// 获得应急物资
export function getEmergencyMaterials(id) {
  return request({
    url: '/biz/emergency-materials/get?id=' + id,
    method: 'get'
  })
}

// 获得应急物资分页
export function getEmergencyMaterialsPage(query) {
  return request({
    url: '/biz/emergency-materials/page',
    method: 'get',
    params: query
  })
}

// 导出应急物资 Excel
export function exportEmergencyMaterialsExcel(query) {
  return request({
    url: '/biz/emergency-materials/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
